<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">{{Lang.lang('最新公告')}}</view>
			<view class="back"></view>
			<!-- <view class="rule">规则</view> -->
		</view>
		<view class="clear_box"></view>

		<view class="page_content">
			<block v-for="(item, index) in notice" :key="'info' + index">
				<view class="content_list" :data-url="'/pages/index/noticecontent?id=' + item.id" @click="gotopage">
					<view class="news_img">
						<image :src="item.image" mode="widthFix"></image>
					</view>
					<view class="content">
						<view class="title">{{item.title}}</view>
						<!-- <view class="text">{{ item.content }}</view> -->
						<view class="time">{{item.create_time}}</view>
					</view>

				</view>
			</block>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				lang: 'en',
				link: '',
				pupu: false,
				scrrol: false,
				info: '',
				notice: []

			}
		},
		onLoad() {

		},
		onShow() {
			let that = this;
			that.loadData();
		},
		methods: {
			loadData() {
				let that = this;
				that.Net._post('api/index/getNotice', {

				}, res => {
					if (res.code == 200) {
						that.notice = res.data.notice
					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
	}
</script>

<style>
	.header {
		background-color: transparent !important;
	}

	.header .text {
		text-align: center;
	}

	.page_content {
		width: 92%;
		margin: 0 auto;
	}

	.scrrolHeader {
		width: 100%;
		background-color: #1A1A1A !important;

	}

	.content_list {
		width: 100%;
		margin: 0 auto;
		border-bottom: 1px solid #f5f5f5;
		padding: 3vw 0vw;
		display: flex;

	}

	.content_list .type {
		font-size: 3.2vw;
		color: #FF7F22;
		margin-left: 8vw;
	}

	.content {
		flex: 1;
	}

	.content .title {
		font-size: 4vw;
		color: #fff;
		font-weight: bold;
		width: calc(100%);
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;

	}

	.content .time {
		font-size: 3.3vw;
		color: #fff;
		margin-top: 1vw;
	}


	.news_img {
		width: 24vw;
		margin-right: 3vw;
	}

	.news_img image {
		width: 100%;
	}
</style>